package com.atguigu.a_calendar;

import java.util.Calendar;


public class Demo {
    public static void main(String[] args) {
        //创建日历类对象
        Calendar calendar = Calendar.getInstance();//多态 : Fu fu = new Zi();

        System.out.println("calendar = " + calendar);

        System.out.println("calendar.get(1) = " + calendar.get(1)); //year -> 1
        System.out.println("calendar.get(Calendar.YEAR) = " + calendar.get(Calendar.YEAR));


        System.out.println("calendar.get(2) = " + calendar.get(2)); //month -> 2
        System.out.println("calendar.get(Calendar.MONTH)  = " + calendar.get(Calendar.MONTH) + 1);

        System.out.println("calendar.get(5) = " + calendar.get(5)); //day -> 5
        System.out.println("calendar.get(Calendar.DAY_OF_MONTH) = " + calendar.get(Calendar.DAY_OF_MONTH));
    }
}
